package moon.search.criterion.predicate;

import java.util.List;

import moon.search.criterion.Criterion;
import moon.search.criterion.IllegalCriterionException;
import moon.search.criterion.PredicateCriterion;

public class ForAll<E> implements PredicateCriterion{

	//private Selector selector;
	private List<E> list;
	
	private Criterion criterion;
	
	public ForAll(List<E> list, Criterion criterion){
		//this.selector = s;
		this.list = list;
		this.criterion = criterion;
	}
	
	public boolean isFulfilled(Object object) throws IllegalCriterionException{
		boolean result = true;
		/*try{

			List<E> listOriginal = this.list;
			Selector selector = new Selector();
			List<E> list = selector.execute(listOriginal,criterion);
			for (E element : listOriginal){
				result &= list.contains(element);
			}		

		}
		catch(IllegalQueryException ex){
			throw new IllegalCriterionException(ex);
		}
		return result;*/
		return false;
	}
}
